package org.example.mapper;

import org.apache.ibatis.annotations.*;
import org.example.entity.Emp;
import org.example.entity.EmpQueryParam;
import org.example.entity.Report;

import java.util.List;
import java.util.Map;

@Mapper
public interface EmpMapper {
       public List<Emp> list(EmpQueryParam param);
       @Options(useGeneratedKeys = true, keyProperty = "id")
       @Insert("INSERT INTO emp(username, name, gender, phone, job, salary, image, entry_date, dept_id, create_time, update_time)" +
        "VALUES (#{username},#{name},#{gender},#{phone},#{job},#{salary},#{image},#{entryDate},#{deptId},#{createTime},#{updateTime})")
       void insert(Emp emp);

    void deleteByIds(List<Integer> ids);

        Emp selectById(Integer id);

    void updateById(Emp emp);

    List<Map<String,Object>> countByJob();

    List<Map> countEmpGenderData();
@Select("SELECT * FROM EMP WHERE username = #{username} AND password = #{password} ")
    Emp selectByUsername(String username, String password);
}
